<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script>
        let input = `3 4 2
        1 5 6 6
8 3 4 3
6 8 6 3`
        let spl = input.split('\n')
        let [N, M, K] = [...spl.shift().split(' ').map(v => parseInt(v))]
        let juzhen = spl.map(item => item.trim().split(' ').map(v => parseInt(v)))
        console.log([N, M, K]);
        console.log(...juzhen);

        let res = null
        let now_list = []
        let end_list = []
        let index_i = new Set()

        function dps(n, list,index_i = new Set()) {
            for (let i = 0; i < M; i++) {
                let T = [...list]
                if(index_i.has(i)){
                    continue
                }
                                
                T.push(juzhen[n][i])
                index_i.add(i)
                
                if (n + 1 < N) {
                    dps(n + 1, [...T],index_i)              
                    
                } else {
                   T= T.sort((a,b)=>{return a-b})
                   now_list.push(T[K-1])                    
                }                

                index_i.delete(i) 
            }

        }

        dps(0, [])

        console.log(Math.min(...now_list) );
        




    </script>
</body>

</html>